-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automate various maintainer tasks #850
Open
JulianOrteil
wants to merge
24
commits into
JaidedAI:master
Choose a base branch
from
ystoll:metamation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…hub official Easyocr repo
Adding changes from github official master branch to bitbucket github_master branch.
JulianOrteil
changed the title
WIP: Automate various maintainer tasks
Automate various maintainer tasks
Oct 10, 2022
@rkcosmos Please review and let me know your thoughts. I'm also willing to split this into smaller PRs if you would like as this has grown larger than I was anticipating. |
@rkcosmos Pinging for review when you have the chance. |
@JaidedTeam @rkcosmos Ready for review! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the first PR in @ystoll and my reworking of the library as discussed in #839. Sticking with our plan in that discussion, this PR is invisible to end users. This should not affect anything they will see or interact with except perhaps remove the need to compile DBNet.
This PR is specifically related to automating various maintainer tasks such as building, testing, publishing, and linting EasyOCR. Some of these processes are not fully implemented (i.e. testing) and are added here in preparation for their use later.
A near exhaustive list of changes this PR implements:
tox
. Here is a description of the available instructions for this tool:tox
- Invoke pytest to run automated tests against Python 3.7, 3.8, 3.9, and 3.10 (no tests, will fail)tox -e build
- Build the package in isolation according to PEP517. Also builds DBNet.tox -e clean
- Remove old distribution files and temporary build artifacts (./build and ./dist)tox -e cleanall
- Same astox -e clean
but also clears out the build artifacts in ./DBNet (log.txt, dcn_compile_success, etc)tox -e docs
- Compile documentation for ReadTheDocs (no docs, will fail)tox -e doctests
- Compile documentation and verify interactive documentation runs as expected (no docs, will fail)tox -e linkcheck
- Check for broken links in the documentation (no docs, will fail)tox -e lint
- Perform static analysis and style checks on the codetox -e publish
- Publish the package totestpypi
orpypi
, depending on the argumentsFully building the library with DBNet is only possible on Linux. I have not yet been able to get it to complete on Windows, hence this PR being a draft.Windows and Linux are now fully supported. I do not have access to a Mac machine, so configuration on that end from someone else would be greatly appreciated!python setup.py install
andpython setup.py develop
fail to compile DBNet. I believe this is because these commands spawn a temporary build environment that does not contain all components required for the successful building of DBNet. I am not sure if this is intended, but it fails nonetheless. Because of this, I have replaced thecmdclass
instructions.tox -e build
. This instruction should handle everything necessary to compile EasyOCR in its entirety, including DBNet. This instruction should be run beforepip install -e .
orpip install .
, but is not required. Either way, as an added bonus, due totox -e build
, DBNet should now be able to ship with base EasyOCR, or as an extra (i.e.pip install easyocr[dbnet]
). We can explore this option later.tox -e lint
git tag -a vX.X.X -m "Production release vX.X.X"
tox -e cleanall
tox -e build
tox -e publish
<--- only for dev, alpha, beta, and release candidate builds of EasyOCROR
tox -e publish -- --repository pypi
<--- only for production releases of EasyOCRsetup.py
has been deprecated for some time now. As such, I have moved all configurations tosetup.cfg
in favor of using tox instructions which callpytest
,python -m build
, andtwine
. Each of these usesetup.cfg
for configuration.pyproject.toml
would be better; however, some tools have yet to add support for that standard, so we'll stick withsetup.cfg
for now.git tag
as seen above. No need to statically set the version in__init__.py
.subprocess.run(..., shell=True)
exists.I will update this PR as time allows, but please feel free to give it a try in the meantime. I am open to any and all feedback.This PR is ready for review and testing. As stated above, I do not have access to a MacOS device, so this PR will likely fail in-part on that platform. Please feel free to add any necessary changes to support the platform.